package com.anbang.website.service;

import java.util.Map;

import com.google.common.collect.Maps;

import net.sf.json.JSONObject;

/**
 * 系统核心服务 helper
 */
public class SystemServiceHelper {
	
	public static JSONObject test(){
		return ServiceHelper.get("/test", "{}");
	}

	/**
	 * 客户登录
	 * 
	 * @param userName
	 * @param passWord
	 * @return
	 */
	public static JSONObject login(String loginName, String password) {
		return ServiceHelper.post(ServiceDefine.SVR_LOGIN, String.format("{\"loginName\":\"%s\", \"password\":\"%s\"}", loginName, password));
	}
	
	/**
	 * 修改密码
	 * 
	 * @param userId
	 * @param oldpassword
	 * @param newpassword
	 * @return
	 */
	public static JSONObject modpwd(String loginName, String oldpassword, String newpassword) {
		Map<String, Object> map = Maps.newHashMap();
		map.put("loginName", loginName);
		map.put("oldpassword", oldpassword);
		map.put("newpassword", newpassword);
		return ServiceHelper.post(ServiceDefine.SVR_MODPWD, map);
	}	
}
